<?php

/**
 * Class Weixin_Wiframe_module
 */
class Weixin_Wiframe_module extends CI_Module
{
    public $weixin_model;
    public $setting;

    public function __construct()
    {
        parent::__construct();
        $this->load->model('weixin.weixin_model');
        $this->load->model('expert.Expert_model');
        $this->setting = $this->weixin_model->db_get_setting();
        define('TOKEN', @$this->setting['token']);
        define('APPID', @$this->setting['appid']);
        define('APPSECRET', @$this->setting['appsecret']);

        $this->weixin_model->valid();
    }

    public function onload()
    {
        $titles = array (
            'line' => '线路',
            'ticket' => '门票',
            'adminrole' => '角色管理',
            'adminuser' => '管理员管理',
            'division' => '部门管理',
            'link' => '连接公众号',
            'menu' => '自定义菜单',
            'send' => '群发消息',

        );
        $this->data['title'] = $titles[$_GET['page']];

        $this->data['view'] = 'iframe/' . $_GET['page'];
        $this->loadview($this->data, 'xenon/common/index');
    }
}